﻿@model IEnumerable<TaskManager.Domain.BusinessObjects.ProjectLogEntry>
@using MvcContrib.UI.Grid
@using MvcContrib.Pagination;
@using TaskManager.Web.Extensions

<asp:content id="Content2" contentplaceholderid="head" runat="server">
  <script src="@Url.Content("~/Scripts/Grid.js")" type="text/javascript"></script>
</asp:content>

<script type="text/javascript">
    $(function () {
        EnableAjaxForGrid('logList');
    });
</script>

@{
    Html.Grid(Model)
        .Sort(ViewBag.sort as GridSortOptions)
        .Empty("There are no log entries available")
        .Columns(column =>
        {
            column.For(log => log.Created).Named("Date").Sortable(true);
            column.For(log => log.Message).Named("Message").Sortable(false);
            column.For(log => log.User).Named("User").Sortable(false);
        }).Render();  
}

@Html.Pager((IPagination)Model, 10, (linkText, routeValues) => Html.ActionLink(linkText, "Log", routeValues).ToString())